<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>添加猫咪</title>
    <link rel="stylesheet" href="../../plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/adopt/indexCss.css" type="text/css">
    <style>
        .layui-form-label {
            text-align: center;
        }
    </style>
</head>

<body>

<!-- 导航栏 -->
<ul class="layui-nav" id="header">
    <div class="container">
        <li class="layui-nav-item"><a href="/MagicFrog/index.html"><b style="font-size: 20px;">膜蛤猫舍</b></a></li>
        <li class="layui-nav-item layui-this"><a href="/MagicFrog/views/foster/foster.html">寄养猫咪</a></li>
        <li class="layui-nav-item"><a href="/MagicFrog/views/adopt/adoptCat.html">领养猫咪</a></li>
        <li class="layui-nav-item"><a href="/MagicFrog/views/personal/aboutus.html">关于我们</a></li>
        <ul class="navbar-right">
            <li class="layui-nav-item">
                <a href="/MagicFrog/views/personal/personal-center.html">个人中心</a>
            </li>
            <li class="layui-nav-item" lay-unselect="">
                <a href="/MagicFrog/views/personal/personal-center.html"><img src="//t.cn/RCzsdCq"
                                                                              class="layui-nav-img">我</a>
                <dl class="layui-nav-child">
                    <dd><a href="#">修改信息</a></dd>
                    <dd><a href="#">安全管理</a></dd>
                    <dd><a href="#">退了</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="#contactus">联系我们</a></li>
        </ul>
    </div>
</ul>

<!-- 填写领养表 -->
<div class="container">
    <form class="layui-form" action="">
        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">猫咪名字</label>
                <div class="layui-input-block">
                    <input type="text" name="userName" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">猫咪几岁</label>
                <div class="layui-input-block">
                    <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">猫咪体重</label>
                <div class="layui-input-block">
                    <input type="text" name="email" lay-verify="email" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label" style="text-align: center">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="公" title="公" checked="">
                <input type="radio" name="sex" value="母" title="母">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否疫苗</label>
            <div class="layui-input-block">
                <input type="radio" name="adopt" value="是" title="是" checked="">
                <input type="radio" name="adopt" value="否" title="否">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">猫咪品种</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="title" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="btn btn-default" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="btn btn-default">重置</button>
            </div>
        </div>

    </form>
</div>

<!-- 底部 -->
<div class="container">
    <div>
        <h3 id="welcome">联系我们</h3>
    </div>
    <div class="col-md-4">
        <h4>
            <i class="	glyphicon glyphicon-map-marker"></i>&nbsp;&nbsp;Location
        </h4>
        <p>345 Setwant natrer,</p>
        <p>Metropolitan, Italy.</p>
    </div>
    <div class="col-md-4">
        <h4>
            <i class="glyphicon glyphicon-earphone"></i>&nbsp;&nbsp;PHONE
        </h4>
        <p>+1(401) 1234 567.</p>
        <p>+1(804) 4261 150.</p>
    </div>
    <div class="col-md-4">
        <h4>
            <i class="glyphicon glyphicon-envelope"></i>&nbsp;&nbsp;E-MAIL
        </h4>
        <p>
            <a href="mailto:info@example.com">Example1@gmail.com</a>
        </p>
        <p>
            <a href="mailto:info@example.com">Example2@gmail.com</a>
        </p>
    </div>
</div>

<script src="../../plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="../../plugins/jquery/jquery.min.js"></script>
<script src="../../plugins/layui/layui.js" charset="utf-8"></script>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 5) {
                    return '标题至少得5个字符啊';
                }
            }
            , pass: [
                /^[\S]{6,12}$/
                , '密码必须6到12位，且不能出现空格'
            ]
            , content: function (value) {
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function (data) {
            layer.msg('开关checked：' + (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });

        //监听提交
        form.on('submit(demo1)', function (data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });

        //表单赋值
        layui.$('#LAY-component-form-setval').on('click', function () {
            form.val('example', {
                "username": "贤心" // "name": "value"
                , "password": "123456"
                , "interest": 1
                , "like[write]": true //复选框选中状态
                , "close": true //开关状态
                , "sex": "女"
                , "desc": "我爱 layui"
            });
        });

        //表单取值
        layui.$('#LAY-component-form-getval').on('click', function () {
            var data = form.val('example');
            alert(JSON.stringify(data));
        });

    });
</script>
</body>

</html>